package org.dromara.comm.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.dromara.comm.domain.AsServiceChannels;
import org.dromara.comm.domain.AsServicePlatform;
import org.dromara.comm.domain.AsServicePlatformEchoDisplay;
import org.dromara.comm.service.AsServiceChannelsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * 办事通控制层
 *
 * @author: 郭伟明
 * @date: 2024-07-31 11:26
 **/
@RestController
@RequestMapping("/asServiceChannels")
@Tag(name = "办事通管理")
public class AsServiceChannelsController {

    @Autowired
    private AsServiceChannelsService asServiceChannelsService;

    @Operation(summary = "办事通查询")
    @PostMapping("/serviceGuideAll")
    private ResponseEntity<Object> serviceGuideAll(@RequestBody AsServiceChannels asServiceChannels) {
        return new ResponseEntity<>(asServiceChannelsService.serviceGuideAll(asServiceChannels), HttpStatus.OK);
    }


    @Operation(summary = "添加服务指南")
    @PostMapping("/insertAsServiceChannels")
    private void insertAsServiceChannels(@RequestBody AsServiceChannels asServiceChannels) {
      asServiceChannelsService.insertAsServiceChannels(asServiceChannels);
    }

    @Operation(summary = "添加政务服务")
    @PostMapping("/insertAsServicePlatformEchoDisplay")
    private void asServicePlatformEchoDisplay(@RequestBody AsServicePlatformEchoDisplay asServicePlatformEchoDisplay) {
        asServiceChannelsService.insertAsServicePlatformEchoDisplay(asServicePlatformEchoDisplay);
    }

    @Operation(summary = "修改政务服务")
    @PostMapping("/updateAsServicePlatformEchoDisplay")
    private void updateAsServicePlatformEchoDisplay(@RequestBody AsServicePlatformEchoDisplay asServicePlatformEchoDisplay) {
        asServiceChannelsService.updateAsServicePlatformEchoDisplay(asServicePlatformEchoDisplay);
    }

    @Operation(summary = "删除政务服务")
    @GetMapping("/deleteAsServicePlatformEchoDisplay")
    private void deleteAsServicePlatformEchoDisplay(AsServicePlatformEchoDisplay asServicePlatformEchoDisplay) {
        asServiceChannelsService.deleteAsServicePlatformEchoDisplay(asServicePlatformEchoDisplay);
    }

    @Operation(summary = "查询全部的服务指南信息")
    @GetMapping("/queryServicePlatform")
    private ResponseEntity<Object> queryServicePlatform (@RequestParam Integer id) {
        return new ResponseEntity<>(asServiceChannelsService.queryServicePlatform(id), HttpStatus.OK);
    }
}
